//
//  TeamsCell.m
//  LOL_JewelBox
//
//  Created by dllo on 15/4/27.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "TeamsCell.h"

@implementation TeamsCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.teamView = [[UIView alloc] init];
        [self.contentView addSubview:self.teamView];
        self.teamView.backgroundColor = [UIColor colorWithRed:230 / 255.0 green:230 / 255.0 blue:230 / 255.0 alpha:1];
        [_teamView release];
        
        // 标题
        self.teamTitle = [[UILabel alloc] init];
        [self.contentView addSubview:self.teamTitle];
        self.teamTitle.font = [UIFont fontWithName:@"Helvetica-Bold" size:16];
        [_teamTitle release];
        
        // 英雄1头像
        self.imagHero1 = [[UIImageView alloc] init];
        [self.contentView addSubview:self.imagHero1];
        [_imagHero1 release];
        
        // 英雄2头像
        self.imagHero2 = [[UIImageView alloc] init];
        [self.contentView addSubview:self.imagHero2];
        [_imagHero2 release];
        
        // 英雄3头像
        self.imagHero3 = [[UIImageView alloc] init];
        [self.contentView addSubview:self.imagHero3];
        [_imagHero3 release];
        
        // 英雄4头像
        self.imagHero4 = [[UIImageView alloc] init];
        [self.contentView addSubview:self.imagHero4];
        [_imagHero4 release];
        
        // 英雄5头像
        self.imagHero5 = [[UIImageView alloc] init];
        [self.contentView addSubview:self.imagHero5];
        [_imagHero5 release];
        
        // 组合简介
        self.teamDes = [[UILabel alloc] init];
        [self.contentView addSubview:self.teamDes];
        self.teamDes.font = [UIFont systemFontOfSize:14];
        self.teamDes.numberOfLines = 0;
        self.teamDes.lineBreakMode = NSLineBreakByCharWrapping;
        [_teamDes release];
    }
    return self;
}

- (void)layoutSubviews
{
    
    self.teamView.frame = CGRectMake(0, 0, CONTENTWIDTH, 145);
    // 铺设位置以及大小
    self.teamTitle.frame = CGRectMake(12, 0, CONTENTWIDTH - 20, 30);
    
    self.imagHero1.frame = CGRectMake(10, 30, (CONTENTWIDTH - 60) / 5, (CONTENTWIDTH - 60) / 5);
    self.imagHero2.frame = CGRectMake((CONTENTWIDTH - 60) / 5 + 20, 30, (CONTENTWIDTH - 60) / 5, (CONTENTWIDTH - 60) / 5);
    self.imagHero3.frame = CGRectMake((CONTENTWIDTH - 60) * 2 / 5 + 30, 30, (CONTENTWIDTH - 60) / 5, (CONTENTWIDTH - 60) / 5);
    self.imagHero4.frame = CGRectMake((CONTENTWIDTH - 60) * 3 / 5 + 40, 30, (CONTENTWIDTH - 60) / 5, (CONTENTWIDTH - 60) / 5);
    self.imagHero5.frame = CGRectMake((CONTENTWIDTH - 60) * 4 / 5 + 50, 30, (CONTENTWIDTH - 60) / 5, (CONTENTWIDTH - 60) / 5);
    
    self.teamDes.frame = CGRectMake(12, 95, CONTENTWIDTH - 20, 40);
    
}


- (void)dealloc
{
    [_teamView release];
    [_teamTitle release];
    [_teamDes release];
    [_imagHero1 release];
    [_imagHero2 release];
    [_imagHero3 release];
    [_imagHero4 release];
    [_imagHero5 release];
    [super dealloc];
}



@end
